<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        class Student{
            id
            name
            #age //私有成员变量
            get age(){
                return this.#age
            }
            set age(age){
                this.#age = age
            }
            static sayHello(){
                console.log(`hello`);
            }
            show(){
                console.log(this.id,this.name,this.#age);
                
            }
            constructor(id,name,age){
                this.#age = age
                this.id = id
                this.name = name
            }
        }
        let student = new Student(100,"张三",21)
        console.log(student);
        Student.sayHello()
        student.show()
    </script>
</body>
</html>